package com.mall.ibatis.bean;

import java.io.Serializable;
import com.mall.util.StringUtil;
import com.thoughtworks.xstream.XStream;

@SuppressWarnings("serial")
public class Role implements Serializable,ICell
{
	
	 /* Private Fields */
	private String ID;
	private String name;
	
	/* JavaBeans Properties */
	public String getID()
	{
		return ID;
	}
	public void setID(String ID)
	{
		this.ID = ID;
	}
	public String getName()
	{
		return name;
	}
	public void setName(String name)
	{
		this.name = name;
	}
	
	/* ICell method*/
	public String toCell()
	{
		// TODO Auto-generated method stub
		StringBuffer cellBuffer  = new StringBuffer();
		cellBuffer.append("<ID><![CDATA[" + StringUtil.null2Empty(ID)+"]]></ID>");
		cellBuffer.append("<name><![CDATA[" + StringUtil.null2Empty(name)+"]]></name>");
		return cellBuffer.toString();
	}
	
	public String getCellID()
	{
		
		return StringUtil.null2Empty(ID);
		
	}
	
	public String toXML()
	{
		XStream xStream = new XStream();
		xStream.alias(this.getClass().getSimpleName(),this.getClass());
		return xStream.toXML(this);
	}
}